{% extends 'base.html' %}

{% block title %}
    购物车
{% endblock %}

{% block article %}
    <article>
        <div class="">
            <div class="w inner">
                <div class="container ">
                    <div class="row">
                        <div class="col-lg-2">
                            <div class="list-group">
                                <a href="{% url 'user_index' %}" class="list-group-item ">
                                    个人信息
                                </a>
                                <a href="{% url 'user_course' %}" class="list-group-item">我的课程</a>
                                <a href="{% url 'user_shoppingCart' %}" class="list-group-item active">购物车</a>
                            </div>
                        </div>
                        <!--个人信息-->
                        <div class="col-md-10">
                            <div class="panel panel-default ">
                                <div class="panel-heading">
                                    <h3 class="panel-title">购物车信息</h3>
                                </div>
                                <div class="panel-body ">
                                    <div class="col-md-8 col-md-offset-2">
                                        <table class="table table-striped table-bordered table-hover">
                                            <thead>
                                                <tr>
                                                    <th>课程名称</th>
                                                    <th>价格</th>
                                                    <th>上线时间</th>
                                                    <th>操作</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                {% for course in course_s %}
                                                      <tr>
                                                        <td>{{ course.courseName }}</td>
                                                        <td>{{ course.price }}</td>
                                                        <td>{{ course.createDatetime|date:"Y-m-d" }}</td>
                                                        <td><a href="{% url 'user_purchase' course.id %}">立即购买</a></td>
                                                      </tr>
                                                {% endfor %}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </article>
{% endblock %}
